
<!doctype HTML>
<title>Index</title>
<html>
	<head>
	
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
		<script src="masonry.pkgd.js"></script>
		<link href="css/styles.css" type="text/css" rel="stylesheet" />
	</head>
	<body>
		
<div id='container2' class="containerwidth">	
		<?php
include 'config.php';
include 'functions.php';
	$query = "SELECT * FROM lex WHERE userid  = ". "'" .  ($_SESSION["userid"]) . "'" ;
	//echo $query;
	$result = mysqli_query($con,$query) or die ("Could not get the user lex information");


	while ($row = mysqli_fetch_array($result))
    {
    	$lextitle = $row['lextitle'];
    	$lexcontext = $row['lexcontext'];
		$lexdesc = $row['lexdesc'];
		
		
	echo "<div class='lex'>	<div class='lextitle'>
		$lextitle
	</div>
	<div id='$lexcontext'>
		$lexcontext
	</div>	$lexdesc</div>";		
 	}

?></div>	

		<script>
			var container = document.querySelector('#container2');
			var msnry = new Masonry(container, {
				// options
				columnWidth :225,
				itemSelector : '.lex'
			}); 
</script>




</html>
